/*
 * @Description: 
 * @Version: 0.1
 * @Autor: 许振富 zfgj201511
 * @Date: 2021-11-30 16:52:58
 * @FilePath: \MT500-EM-A39E17-2022-01-17\System\SEGGER\User_RTT\RTT_Log.h
 * @LastEditors: 许振富(jia)
 * @LastEditTime: 2022-03-26 10:23:04
 */

#ifndef __RTT_LOG_H_
#define __RTT_LOG_H_


//log启动标志
#define LOG_EN 0
	#if (LOG_EN == 1)

		#include "stdio.h"
		#include "SEGGER_RTT.h"
		#define LOG_MAX_BUFFER 1024
		extern unsigned char RTT_LOG_BUFFER[LOG_MAX_BUFFER];
		//标准log输出->RTT
		#define DeBug_Log(format, ...)                                                                                  \
			do                                                                                                          \
			{                                                                                                           \
				SEGGER_RTT_Write(0, (void*)RTT_LOG_BUFFER, snprintf((void *)RTT_LOG_BUFFER, sizeof(RTT_LOG_BUFFER), format, ##__VA_ARGS__));\
			} while (0)

		void DeBug_Init(void);		
	#else		
		#define DeBug_Log(format, ...)    
		#define DeBug_Init()		
	#endif
#endif

			
			
